/*
 * 消息管理模块
 */
import { getRequest, postRequest } from '@/lib/axios'
interface MessageApi {
  /**
   * 通知消息-分页查询
   */
  queryMessage: (param) => Promise<any>
  /**
   * 通知消息-查询未读消息数
   */
  queryUnreadCount: () => Promise<any>
  /**
   * 通知消息-标记已读
   */
  updateReadFlag: (param) => Promise<any>
  /**
   * 分类下拉框
   */
  queryCategory: () => Promise<any>
}
export const messageApi: MessageApi = {
  queryMessage: (param) => {
    return getRequest('/message_notification/list', param)
  },
  queryUnreadCount: () => {
    return getRequest('/message_notification/count')
  },
  updateReadFlag: (id) => {
    return getRequest(`/message_notification/${id}`)
  },
  queryCategory: () => {
    return getRequest('/message_notification/types')
  }
  // updateReadFlag: (messageId) => {
  //   return getRequest(`/support/message/read/${messageId}`)
  // }
}
